package com.chen.service.serviceimpl;

import com.chen.dao.StudentDao;
import com.chen.dao.TeacherDao;
import com.chen.dao.UserDao;
import com.chen.pojo.User;
import com.chen.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;
    @Autowired
    private  TeacherDao teacherDao;
    @Autowired
    private StudentDao studentDao;

    @Override
    public User getAdminByUserName(String username) {
        return userDao.getAdminByUserName(username);
    }

    @Override
    public User getTeacherByUserName(String username) {
        return teacherDao.getTeacherByUserName(username);
    }

    @Override
    public User getStudentByUserName(String username) {
        return studentDao.getStudenByUserName(username);
    }

    @Override
    public void updatePassword(User user) {
        userDao.updatePassword(user);
    }
}
